<?php
namespace Home\Controller;
use Think\Controller;
class NewsController extends Controller
{
	//新闻列表展示并分页
	public function index()
	{
		$news = M('news');
		$count = $news->count();
		$page = new \Think\Page($count,6);
		$show = $page->show();
		$list = $news->order('addtime desc')->limit($page->firstRow.','.$page->listRows)->select();
		$this->assign('news',$list);
		$this->assign('show',$show);
		$this->display();
	}
	//查看新闻
	public function news()
	{
		$news = D('news');
		$list = $news->news_show();
		$this->assign('list',$list);
		$this->display();
	}
}